<?php
/**
 * Created by PhpStorm.
 * User: zty
 * Date: 2018/10/28
 * Time: 11:28
 */

namespace app\admin\controller;

use think\App;
use think\Controller;
class Index extends Controller
{
    protected $user_id;

    public function __construct(App $app = null)
    {
        parent::__construct($app);


    }

    public function index(){
        $config = model('common/config')->get_one();
        $data['note'] = $config['note'];

        $data['count_1'] = model('common/order')->count_status(1,0,1,0,1);
        $data['count_2'] = model('common/order')->count_status(1,0,2,0,1);
        $data['count_3'] = model('common/order')->count_status(1,0,3,0,1);

        return ['code'=>0,'msg'=>'获取数据成功','data'=>$data];
    }


    public function note_update($note=''){
        //todo  判断是否具有修改权限
        $r = model('common/config')->note_update($note);
        if($r){
            return ['code'=>0,'msg'=>'修改成功'];
        }else{
            return ['code'=>1,'msg'=>'修改失败'];
        }
    }
}